package com.xmall.sys.service.remote;

import com.xmall.define.base.Result;
import com.xmall.define.dto.auth.AccountDto;
import com.xmall.define.dto.auth.AccountUpdateRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 微服务 - auth：Account
 */
@FeignClient(value = "xmall-auth")
public interface AuthAccountServiceFeign {

    /**
     * 账号是否已存在
     */
    @GetMapping("/service/auth/sys/account/exists/{account}")
    Result<Boolean> exist(@PathVariable("account") String account);

    /**
     * 新增
     */
    @PostMapping("/service/auth/sys/account/save")
    Result save(@RequestBody AccountUpdateRequest request);

    /**
     * 指定用户账号信息
     */
    @PostMapping("/service/auth/sys/account/listByUserIds")
    Result<List<AccountDto>> listByUserIds(@RequestBody List<Long> userIds);
}
